<?php 


require '../dao/ridegamerdao.php';
session_start();
$ridegamerid=$_GET['ridegamerid'];//获取到要查询的骑士的id
$delid=$_GET['delid'];//获取到要删除的骑士的id
$dao=new ridegamerdao();
$ridegamerdel=$dao->Del($delid);//删除骑士
$ridegamerlist=$dao->Chaxun($ridegamerid);//查询id
// if(empty($_POST['ridegamer'])){
// 	$infoo= "请输入";
// }
?>
<table class="tab">
<tr>
	<td>骑士ID</td>
	<td>名称</td>
	<td>等级</td>
	<td>作用</td>
	<td>价格</td>
	<td>图片</td>
	<td>修改骑士信息</td>
	<td>删除骑士</td>
</tr>
 <?php 
 foreach ($ridegamerlist as $gamer){ ?>
 <tr>
	<?php foreach ($gamer as $i=>$value){ ?>
	<td>
	<?php if ($i=='img'){
	if(strpos($value,"/")!=false){
	echo "<img src='../../qian/".$value."'/>";
	}else
	echo "<img src='../view/img.php?src=".$value."'/>";
   }
   else {echo $value; }?>
   	</td>
	<?php }?>
	<td><form  action="../controller/handout.php?con=ridegamer&action=rerider&ridegamerid=<?php echo $gamer['id'] ?>" method="post">
	名称：<input type='text' name='ming'/>
	作用：<input type='text' name='zuo'/>
	价格：<input type='text' name='jia'/>
    <input type="submit"  value="修改"/>
    </form>
    </td>
    <td><a href="main.php?url=ridegamer.php&delid=<?php echo $gamer['id']?>">删除</a></td> 
    </tr>
    <?php } ?>
</table>
<form  action="../controller/handout.php?con=ridegamer&action=tian" enctype="multipart/form-data" method="post">
<table>	
    <tr><td>名称：<input type='text' name='tming' placeholder="可输入中英数"/></td></tr>
	<tr><td>作用：<input type='text' name='tzuo' placeholder="可输入中英数"/></td></tr>
	<tr><td>等级：<input type='text' name='tlevel' placeholder="可输入数字"/></td></tr>
	<tr><td>价格：<input type='text' name='tjia' placeholder="可输入数字"/></td></tr>
    <tr><td>图片：<input type="file"  name='file'/></tr></td> 
    <tr><td><input type="submit"  value="添加骑士信息"/></td></tr>
    </table>
    </form>


